package com.xjrh.traintravel.collector.netty.command.fault;

import com.xjrh.traintravel.collector.netty.command.BaseCommand;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * 部件故障
 *  <p>
 *      算法检测后上报的部件故障
 *  </p>
 *
 * @author snps
 * @create 2023-10-26 13:47
 * @describe
 **/
public class PartFault extends BaseCommand implements Serializable {

    private static final long serialVersionUID = 5480222733003474258L;


    /** 故障分类 */
    private int faultType;

    /** 时间（年月日时分秒） */
    private String time;

    /** 段 */
    private String duan;

    /** 列 */
    private String lie;

    /** 车 */
    private String che;

    /**
     * 转向架（转向架对应主机的通讯口）
     *      转向架1-COM1：1
     *      转向架2-COM2：2
     */
    private int com;

    /**
     * 前置类型
     *      I型前置：1
     *      II型前置：2
     */
    private int frontType;

    /**
     * 前置通道（对应传感器）
     */
    private int frontAccess;

    /** 故障数量 */
    private Integer faultCount;

    /**
     * 故障监测结果（包括多个：部件故障-详细信息 --> PartFaultDetails)
     */
    private String faultDetails;

    /** 部件故障-详细信息（多个） */
    private List<PartFaultDetails> details;

    /** 数据文件名 */
    private String originalDataFilename;


    /*****************************************
     * Getter and Setter
     */
    public int getFaultType() {
        return faultType;
    }

    public void setFaultType(int faultType) {
        this.faultType = faultType;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getDuan() {
        return duan;
    }

    public void setDuan(String duan) {
        this.duan = duan;
    }

    public String getLie() {
        return lie;
    }

    public void setLie(String lie) {
        this.lie = lie;
    }

    public String getChe() {
        return che;
    }

    public void setChe(String che) {
        this.che = che;
    }

    public int getCom() {
        return com;
    }

    public void setCom(int com) {
        this.com = com;
    }

    public int getFrontType() {
        return frontType;
    }

    public void setFrontType(int frontType) {
        this.frontType = frontType;
    }

    public int getFrontAccess() {
        return frontAccess;
    }

    public void setFrontAccess(int frontAccess) {
        this.frontAccess = frontAccess;
    }

    public Integer getFaultCount() {
        return faultCount;
    }

    public void setFaultCount(Integer faultCount) {
        this.faultCount = faultCount;
    }

    public String getFaultDetails() {
        return faultDetails;
    }

    public void setFaultDetails(String faultDetails) {
        this.faultDetails = faultDetails;
    }

    public List<PartFaultDetails> getDetails() {
        return details;
    }

    public void setDetails(List<PartFaultDetails> details) {
        this.details = details;
    }

    public String getOriginalDataFilename() {
        return new StringBuilder()
                .append(this.getTime()).append("-")
                .append(this.getCom()).append(this.getFrontType()).append(this.getFrontAccess()).append("-")
                .append(this.getFaultType())
                .toString();
    }

    public void setOriginalDataFilename(String originalDataFilename) {
        this.originalDataFilename = originalDataFilename;
    }


}